﻿@model List<VipSoft.Membership.Core.Entity.Menu>
@{ 
    var categoryIndex = 1;
    if (Request.RequestContext.RouteData.Values["cid"] != null)
    {
        try
        {
            categoryIndex = Convert.ToInt32(Request.RequestContext.RouteData.Values["cid"]);
        }
        catch
        {
            Response.Redirect("/VipSoft");
        }
    }
    var menuIndex = 1;
    if (Request.RequestContext.RouteData.Values["mid"] != null)
    {
        try
        {
            menuIndex = Convert.ToInt32(Request.RequestContext.RouteData.Values["mid"]);
        }
        catch
        {
            Response.Redirect("/VipSoft");
        }
    }
}

<div id="sidebar" class="sidebar responsive">
    <script type="text/javascript">
        try { ace.settings.check('sidebar', 'fixed') } catch (e) { }
    </script>

    <div class="sidebar-shortcuts" id="sidebar-shortcuts">
        <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
            <button class="btn btn-success">
                <i class="ace-icon fa fa-signal"></i>
            </button>
            <a class="btn btn-warning" href="@Url.Action("Index", "Main", new { pid = 101})" title="CMS">
                <i class="ace-icon fa fa-users"></i>
            </a>
            <a class="btn btn-danger" href="@Url.Action("Index", "Main", new { pid = 201})" title="用户管理">
                <i class="ace-icon fa fa-cogs"></i>
            </a>
            <button class="btn btn-info" href="@Url.Action("Index", "Main", new { pid = 201})" title="系统设置">
                <i class="ace-icon fa fa-pencil"></i>
            </button>
        </div>

        <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
            <span class="btn btn-success"></span>

            <span class="btn btn-info"></span>

            <span class="btn btn-warning"></span>

            <span class="btn btn-danger"></span>
        </div>
    </div>
    <!-- /.sidebar-shortcuts -->

    <ul class="nav nav-list">
        <li class="active">
            <a href="/vipsoft/">
                <i class="menu-icon fa fa-tachometer"></i>
                <span class="menu-text"> 首页 </span>
            </a>

            <b class="arrow"></b>
        </li>
        @foreach (var menu in Model.FindAll(p => p.ParentId == ViewBag.ParentId))
        {
            <li @if (categoryIndex == @menu.ID){ @Html.Raw("class=\"active open\"")   }>
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon @menu.Icon"></i>
                    <span class="menu-text"> @menu.Name </span>
                    <b class="arrow fa fa-angle-down"></b>
                </a>
                <b class="arrow"></b>
                <ul class="submenu">
                    @foreach (var child in Model.FindAll(p => p.ParentId == menu.ID))
                    {
                        <li @if (menuIndex == @child.ID){ @Html.Raw("class=\"active\"")   }>
                            <a href="@child.Url">
                                <i class="menu-icon fa fa-caret-right"></i>
                                @child.Name
                            </a>
                            <b class="arrow"></b>
                        </li>
                    }
                </ul>
            </li>
        }
    </ul>

    <!-- /.nav-list -->

    <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
        <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
    </div>

    <script type="text/javascript">
        try { ace.settings.check('sidebar', 'collapsed') } catch (e) { }
    </script>
</div>

<!--
<div title="平台管理" iconcss="menu-icon-model" class="l-scroll">
    <ul id="global_channel_tree" style="margin-top: 3px;">
    </ul>
</div>
<div title="权限设置" iconcss="menu-icon-setting" style="display: none">
    <ul class="nlist">
        @foreach (var menu in Model.FindAll(p => p.ParentId == 201))
        {
            <li><a class="l-link" href="javascript:f_addTab('@menu.ID','@menu.Name','@menu.Url')">@menu.Name</a></li>
        }
    </ul>
</div>

<div title="控制面板" iconcss="menu-icon-setting">
    <ul class="nlist">
        <li><a class="l-link" href="javascript:f_addTab('UpdatePwd','修改密码','/VipSoft/User/ChangePassword')">修改密码</a></li>
    </ul>
</div>

<div title="权限管理" iconcss="menu-icon-plugins">
    <ul class="nlist">
        <li><a class="l-link" href="javascript:f_addTab('listpage31','权限列表','1.htm')">权限列表</a></li>
        <li><a class="l-link" href="javascript:f_addTab('listpage32','新闻采集','1.htm')">权限分配</a></li>
    </ul>
</div>
<div title="控制面板" iconcss="menu-icon-setting">
    <ul class="nlist">
        <li><a class="l-link" href="javascript:f_addTab('sys_config','系统设置','/category/')">系统设置</a></li>
    </ul>
</div>
-->
